package basicCompiler;

import java.util.Stack;
import basicCompiler.visitor.*;

public abstract class AbstractOperand extends Node implements TreeVisitable{
	protected String value;
	
	public AbstractOperand(){
		super();
	}
	
	public AbstractOperand( String exp){
		this();
		this.value = exp;
	}

	public String toString(){
		return value;
	}
	
	// Single dispach visitor
	public void accept(AbstractTreeVisitor v, Stack<Node> results, Stack<AbstractOperator> operators){
		v.visit(this, results, operators);
	}
}

class Variabile extends AbstractOperand{
	protected String value;
	
	public Variabile(String exp) {
		super(exp);
	}
	
}

class IntegerValue extends AbstractOperand{
	protected int value;
	
	public IntegerValue(String exp) {
		super();
		this.value = Integer.parseInt(exp);
	}
	
	public String toString(){
		return (new Integer(value)).toString();
	}
}

class BooleanValue extends AbstractOperand {
	String value;
	
	public BooleanValue(String exp) {
		super(exp);
	}
	
}